package org.Swing;

import javax.swing.*;

public class SimpleFrameTest {
    public static void main(String[] args) {
        SimpleFrame frame = new SimpleFrame();
        frame.active();
    }

    static class SimpleFrame extends JFrame {
        public SimpleFrame() {
            setTitle("Simple Frame");
            setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel panel = new JPanel();
            JButton button = new JButton("Click Me");
            JLabel label = new   JLabel("Hello");
            panel.add(button);
            panel.add(label);
            add(panel);
        }

        public void active() {
            setVisible(true);
        }

        public static final int DEFAULT_WIDTH = 300;
        public static final int DEFAULT_HEIGHT = 200;
    }
}
